/*
 * $Id: Rsc.java,v 1.10 2002/06/15 16:52:52 jppietsch Exp $
 * Copyright (C) 2002 Jan-Peter Pietsch
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
package de.jppietsch.prefedit;


import de.jppietsch.gui.MainWindow;
import de.jppietsch.util.RscBundle;


/**
 * This package's resources for the default locale (english).
 *
 * @author Jan-Peter Pietsch
 * @version $Revision: 1.10 $
 */
public class Rsc extends RscBundle {

    // constants

    /**
     * Resource key for the "unsufficient Java version" message.
     */
    static final String JAVA_VERSION_MESSAGE = "javaVersionMessage";

    /**
     * Resource key for the title of the table column, which displays the
     * preferences keys.
     */
    static final String KEY_COLUMN_NAME = "keyColumnName";

    /**
     * Resource key for the title of the table column, which displays the
     * preferences values.
     */
    static final String VALUE_COLUMN_NAME = "valueColumnName";

    /**
     * Resource key for default text in case of errors.
     */
    static final String ERROR = "error";

    /**
     * Resource key of the root nodes label.
     */
    static final String ROOT = "root";

    /**
     * Resource key of the user preferences root label.
     */
    static final String USER_ROOT = "userRoot";

    /**
     * Resource key of the system preferences root label.
     */
    static final String SYSTEM_ROOT = "systemRoot";

    /**
     * Resource key of the input message used by the "new key" action.
     */
    static final String NEW_KEY_MESSAGE = "newKeyMessage";

    /**
     * Resource key of the input message used by the "new node" action.
     */
    static final String NEW_NODE_MESSAGE = "newNodeMessage";

    /**
     * Resource key prefix of the import action.
     */
    static final String IMPORT = "import";

    /**
     * Resource key prefix of the export action.
     */
    static final String EXPORT = "export";

    /**
     * Common prefix of the edit menu's resource keys.
     */
    static final String EDIT = "edit";

    /**
     * Common prefix of the "new key" action's resource keys.
     */
    static final String NEW_KEY = "newKey";

    /**
     * Common prefix of the cut action's resource keys.
     */
    static final String CUT = "cut";

    /**
     * Common prefix of the copy action's resource keys.
     */
    static final String COPY = "copy";

    /**
     * Common prefix of the paste action's resource keys.
     */
    static final String PASTE = "paste";

    /**
     * Common prefix of the "new node" action's resource keys.
     */
    static final String NEW_NODE = "newNode";

    // overwritten methods

    /**
     * All resources are created inside this method.
     * It's called only once by the base class.
     *
     * @return Array of key value pairs.
     * @see RscBundle#getContents()
     */
    protected Object[][] contents() {
        return new Object[][]{
                {MainWindow.TITLE, "Preferences Editor"},
                {JAVA_VERSION_MESSAGE, "Unsufficient Java Version " +
                        System.getProperty("java.version") +
                        "! (Needs at least 1.4.)"},

                {MainWindow.FILE + NAME, "File"},
                {MainWindow.FILE + MNEMO, mnemo('F')},
                {MainWindow.EXIT + NAME, "Exit"},
                {MainWindow.EXIT + MNEMO, mnemo('x')},
                {MainWindow.EXIT + ACCEL, altAccel(F4)},
                {IMPORT + NAME, "Import..."},
                {IMPORT + MNEMO, mnemo('I')},
                {EXPORT + NAME, "Export..."},
                {EXPORT + MNEMO, mnemo('E')},

                {EDIT + NAME, "Edit"},
                {EDIT + MNEMO, mnemo('E')},
                {NEW_KEY + NAME, "New key..."},
                {NEW_KEY + MNEMO, mnemo('k')},
                {CUT + NAME, "Cut"},
                {CUT + MNEMO, mnemo('t')},
                {CUT + ACCEL, shiftAccel(DELETE)},
                {COPY + NAME, "Copy"},
                {COPY + MNEMO, mnemo('C')},
                {COPY + ACCEL, ctrlAccel(INSERT)},
                {PASTE + NAME, "Paste"},
                {PASTE + MNEMO, mnemo('P')},
                {PASTE + ACCEL, shiftAccel(INSERT)},
                {NEW_NODE + NAME, "New node..."},
                {NEW_NODE + MNEMO, mnemo('N')},

                {KEY_COLUMN_NAME, "Key"},
                {VALUE_COLUMN_NAME, "Value"},
                {ERROR, "<error>"},
                {ROOT, "Preferences"},
                {USER_ROOT, "User Preferences"},
                {SYSTEM_ROOT, "System Preferences"},
                {NEW_KEY_MESSAGE, "New key:"},
                {NEW_NODE_MESSAGE, "New node:"}
        };
    }

    // package methods

    /**
     * Convenient accessor.
     *
     * @return Localized instance of this bundle.
     */
    static RscBundle getBundle() {
        return getBundle(Rsc.class);
    }

}
